

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;


public class Icons{

	
	final ImageIcon symbol;
	
	public Icons(String name){
		symbol = new ImageIcon(iconEinlesen(name));
	}
	
	/*
	 * liest die Grafik fuer das Bild auf den Buttons ein
	 */
	protected static BufferedImage iconEinlesen(String name) {
		BufferedImage bi = null;
		try {
			if(name.equals("anthill")){
				bi = ImageIO.read(Icons.class.getResourceAsStream("hill.jpg"));
			}else if(name.equals("feed")){
				bi = ImageIO.read(Icons.class.getResourceAsStream("food.jpg"));
			}else{
				bi = ImageIO.read(Icons.class.getResourceAsStream("ICOn.jpg"));
			}
				
			
		} catch (IOException e) {
			e.printStackTrace();
			System.out.println("Image not found!");
		}
		//this.setIconImage(bi);
		return bi;
	}// Icon iconEinlesen()
	
	
	public ImageIcon getIcon(){
		return this.symbol;
	}
	
	
}//class ColorChangeSymbol
